.class public Lde/dealdoktor/app/activities/Details;
.super Lde/dealdoktor/app/activities/SuperDetails;
.source "Details.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lde/dealdoktor/app/activities/Details$DealPagerAdapter;
    }
.end annotation


# instance fields
.field private dealAdapter:Lde/dealdoktor/app/activities/Details$DealPagerAdapter;

.field private dealPager:Landroid/support/v4/view/ViewPager;

.field private settings:Landroid/content/SharedPreferences;


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 25
    invoke-direct {p0}, Lde/dealdoktor/app/activities/SuperDetails;-><init>()V

    return-void
.end method

.method static synthetic access$0(Lde/dealdoktor/app/activities/Details;)Landroid/content/SharedPreferences;
    .locals 1
    .parameter

    .prologue
    .line 29
    iget-object v0, p0, Lde/dealdoktor/app/activities/Details;->settings:Landroid/content/SharedPreferences;

    return-object v0
.end method


# virtual methods
.method protected onCreate(Landroid/os/Bundle;)V
    .locals 7
    .parameter "savedInstanceState"

    .prologue
    const v6, 0x1080027

    const/4 v5, 0x1

    const/4 v4, 0x0

    .line 33
    invoke-virtual {p0}, Lde/dealdoktor/app/activities/Details;->getIntent()Landroid/content/Intent;

    move-result-object v1

    const-string v2, "postId"

    invoke-virtual {v1, v2, v4}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v1

    iput v1, p0, Lde/dealdoktor/app/activities/Details;->currentPostIndex:I

    .line 34
    sget-object v1, Lde/dealdoktor/app/App;->posts:Ljava/util/ArrayList;

    iget v2, p0, Lde/dealdoktor/app/activities/Details;->currentPostIndex:I

    invoke-virtual {v1, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lde/dealdoktor/app/data/PostDAO;

    invoke-super {p0, p1, v1}, Lde/dealdoktor/app/activities/SuperDetails;->onCreate(Landroid/os/Bundle;Lde/dealdoktor/app/data/PostDAO;)V

    .line 38
    new-instance v0, Lde/dealdoktor/app/db/BaseModel;

    const-string v1, "info"

    invoke-direct {v0, p0, v1}, Lde/dealdoktor/app/db/BaseModel;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    .line 39
    .local v0, infoModel:Lde/dealdoktor/app/db/BaseModel;
    const-string v1, "first_use"

    invoke-virtual {v0, v1}, Lde/dealdoktor/app/db/BaseModel;->getValue(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, ""

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 40
    new-instance v1, Landroid/app/AlertDialog$Builder;

    invoke-virtual {p0}, Lde/dealdoktor/app/activities/Details;->getParent()Landroid/app/Activity;

    move-result-object v2

    invoke-direct {v1, v2}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    invoke-virtual {v1, v6}, Landroid/app/AlertDialog$Builder;->setIcon(I)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    const-string v2, "TIPP"

    invoke-virtual {v1, v2}, Landroid/app/AlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    .line 41
    const-string v2, "Wischen mit dem Finger nach links oder rechts bringt Dich zum vorherigen oder n\u00e4chsten Schn\u00e4ppchen."

    invoke-virtual {v1, v2}, Landroid/app/AlertDialog$Builder;->setMessage(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    .line 42
    const-string v2, "OK"

    new-instance v3, Lde/dealdoktor/app/activities/Details$1;

    invoke-direct {v3, p0}, Lde/dealdoktor/app/activities/Details$1;-><init>(Lde/dealdoktor/app/activities/Details;)V

    invoke-virtual {v1, v2, v3}, Landroid/app/AlertDialog$Builder;->setPositiveButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    .line 47
    invoke-virtual {v1}, Landroid/app/AlertDialog$Builder;->show()Landroid/app/AlertDialog;

    .line 48
    const-string v1, "first_use"

    const-string v2, "1"

    invoke-virtual {v0, v1, v2}, Lde/dealdoktor/app/db/BaseModel;->replace(Ljava/lang/String;Ljava/lang/String;)V

    .line 53
    :cond_0
    const-string v1, "dealdoktor_preferences"

    invoke-virtual {p0, v1, v4}, Lde/dealdoktor/app/activities/Details;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v1

    iput-object v1, p0, Lde/dealdoktor/app/activities/Details;->settings:Landroid/content/SharedPreferences;

    .line 55
    iget-object v1, p0, Lde/dealdoktor/app/activities/Details;->settings:Landroid/content/SharedPreferences;

    const-string v2, "showRatingDialog"

    invoke-interface {v1, v2, v5}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v1

    if-eqz v1, :cond_1

    iget-object v1, p0, Lde/dealdoktor/app/activities/Details;->settings:Landroid/content/SharedPreferences;

    const-string v2, "appStarts"

    invoke-interface {v1, v2, v5}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v1

    rem-int/lit8 v1, v1, 0x14

    if-nez v1, :cond_1

    .line 56
    new-instance v1, Landroid/app/AlertDialog$Builder;

    invoke-virtual {p0}, Lde/dealdoktor/app/activities/Details;->getParent()Landroid/app/Activity;

    move-result-object v2

    invoke-direct {v1, v2}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    invoke-virtual {v1, v6}, Landroid/app/AlertDialog$Builder;->setIcon(I)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    .line 57
    const-string v2, "Bewerte DealDoktor"

    invoke-virtual {v1, v2}, Landroid/app/AlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    .line 58
    const-string v2, "Bitte gib Deine Bewertung zur App ab."

    invoke-virtual {v1, v2}, Landroid/app/AlertDialog$Builder;->setMessage(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    .line 59
    const-string v2, "Nicht jetzt"

    new-instance v3, Lde/dealdoktor/app/activities/Details$2;

    invoke-direct {v3, p0}, Lde/dealdoktor/app/activities/Details$2;-><init>(Lde/dealdoktor/app/activities/Details;)V

    invoke-virtual {v1, v2, v3}, Landroid/app/AlertDialog$Builder;->setNeutralButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    .line 64
    const-string v2, "Nie"

    new-instance v3, Lde/dealdoktor/app/activities/Details$3;

    invoke-direct {v3, p0}, Lde/dealdoktor/app/activities/Details$3;-><init>(Lde/dealdoktor/app/activities/Details;)V

    invoke-virtual {v1, v2, v3}, Landroid/app/AlertDialog$Builder;->setNegativeButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    .line 72
    const-string v2, "Bewerten"

    new-instance v3, Lde/dealdoktor/app/activities/Details$4;

    invoke-direct {v3, p0}, Lde/dealdoktor/app/activities/Details$4;-><init>(Lde/dealdoktor/app/activities/Details;)V

    invoke-virtual {v1, v2, v3}, Landroid/app/AlertDialog$Builder;->setPositiveButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v1

    .line 82
    invoke-virtual {v1}, Landroid/app/AlertDialog$Builder;->show()Landroid/app/AlertDialog;

    .line 85
    :cond_1
    new-instance v1, Lde/dealdoktor/app/activities/Details$DealPagerAdapter;

    invoke-virtual {p0}, Lde/dealdoktor/app/activities/Details;->getSupportFragmentManager()Landroid/support/v4/app/FragmentManager;

    move-result-object v2

    invoke-direct {v1, p0, p0, v2}, Lde/dealdoktor/app/activities/Details$DealPagerAdapter;-><init>(Lde/dealdoktor/app/activities/Details;Landroid/content/Context;Landroid/support/v4/app/FragmentManager;)V

    iput-object v1, p0, Lde/dealdoktor/app/activities/Details;->dealAdapter:Lde/dealdoktor/app/activities/Details$DealPagerAdapter;

    .line 87
    const v1, 0x7f0b0006

    invoke-virtual {p0, v1}, Lde/dealdoktor/app/activities/Details;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/support/v4/view/ViewPager;

    iput-object v1, p0, Lde/dealdoktor/app/activities/Details;->dealPager:Landroid/support/v4/view/ViewPager;

    .line 88
    iget-object v1, p0, Lde/dealdoktor/app/activities/Details;->dealPager:Landroid/support/v4/view/ViewPager;

    iget-object v2, p0, Lde/dealdoktor/app/activities/Details;->dealAdapter:Lde/dealdoktor/app/activities/Details$DealPagerAdapter;

    invoke-virtual {v1, v2}, Landroid/support/v4/view/ViewPager;->setAdapter(Landroid/support/v4/view/PagerAdapter;)V

    .line 90
    iget-object v1, p0, Lde/dealdoktor/app/activities/Details;->dealPager:Landroid/support/v4/view/ViewPager;

    iget v2, p0, Lde/dealdoktor/app/activities/Details;->currentPostIndex:I

    invoke-virtual {v1, v2}, Landroid/support/v4/view/ViewPager;->setCurrentItem(I)V

    .line 91
    iget-object v1, p0, Lde/dealdoktor/app/activities/Details;->dealPager:Landroid/support/v4/view/ViewPager;

    new-instance v2, Lde/dealdoktor/app/activities/Details$5;

    invoke-direct {v2, p0}, Lde/dealdoktor/app/activities/Details$5;-><init>(Lde/dealdoktor/app/activities/Details;)V

    invoke-virtual {v1, v2}, Landroid/support/v4/view/ViewPager;->setOnPageChangeListener(Landroid/support/v4/view/ViewPager$OnPageChangeListener;)V

    .line 110
    return-void
.end method
